﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BLL
{
    public partial class LostAndFound
    {
        DAL.LostAndFound dallostandfound = new DAL.LostAndFound();

        #region 根据信息类型lostproperty,pagenum,ordercondition得到总信息
        /// <summary>
        /// 根据信息类型lostproperty,pagenum,ordercondition得到总信息
        /// </summary>
        /// <param name="lostproperty"></param>
        /// <returns></returns>
        public List<MODEL.LostAndFound> getAll(string lostproperty, int pagenum, string ordercondition)
        {
            return dallostandfound.getAll(lostproperty,pagenum,ordercondition);
        }
        #endregion

        #region 修改启事信息
        /// <summary>
        /// 修改启事信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool modifyInfo(MODEL.LostAndFound model)
        {
            return dallostandfound.modifyInfo(model);
        }
        #endregion

        #region 根据Id号(LId)执行软删除
        /// <summary>
        /// 根据Id号(LId)执行软删除
        /// </summary>
        /// <param name="lid"></param>
        public bool softDelByLId(int lid)
        {
            return dallostandfound.softDelByLId(lid);
        }
        #endregion

        #region 根据用户Id号查询相关失物招领信息(个人中心)，返回实体对象
        /// <summary>
        /// 根据用户Id号查询相关失物招领信息，返回实体对象
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public List<MODEL.LostAndFound> getModelsByUserId(int userid, int pagenum, string lostproperty, string ordercondition)
        {
            return dallostandfound.getModelsByUserId(userid, pagenum, lostproperty, ordercondition);
        }
        #endregion

        #region 根据用户Id号以及分类lostproperty获得总页数
        /// <summary>
        /// 根据用户Id号以及分类lostproperty查询总数
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="lostproperty"></param>
        /// <returns></returns>
        public int getPCByUserId(int userid, string lostproperty)
        {
            return dallostandfound.getPCByUserId(userid, lostproperty);
        }
        #endregion

        #region 根据Id号(LId)查询相关失物招领信息，返回实体对象
        /// <summary>
        /// 根据Id号查询相关失物招领信息，返回实体对象
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public List<MODEL.LostAndFound> getModelById(int id)
        {
            return dallostandfound.getModelById(id);
        }
        #endregion

        #region 发布信息，插入数据
        /// <summary>
        /// 发布信息，插入数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool publishInfo(MODEL.LostAndFound model,out int lid)
        {
            return dallostandfound.publishInfo(model,out lid);
        }
        #endregion
    }
}
